<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
  <!-- 
        使用变量先看那个模板里面用，就在那里查找
        组件有自己的作用域
   -->

    <div id="app">
      <cpn v-show="isShow"></cpn>
    </div>
    <template id="cpn">
        <div>
           <h2>我是子组件</h2>
           <p>hahha </p>
           <button v-show="isShow"></button>
        </div>
    </template>
    <script src="../js/vue.js"></script>
    <script>
        const app = new Vue({
            el:'#app',
            data:{
                message:'你好呀！',
                isShow:true
            },
            components:{
                cpn:{
                    template:"#cpn",
                    data(){
                        return{
                            isShow:false
                        }
                    }
                  
                }
            }
        })
    </script>
</body>
</html>